import http from '@/util/request'

export default {
    getCarById: (id) => {
        return http({
            url: `api/car/${id}`,
            method: 'get'
        })
    },
    
    getCarList: (data) => {
        return http({
            url: 'api/car/list',
            method: 'post',
            data
        })
    },
    
    addCar: (data) => {
        return http({
            url: 'api/car',
            method: 'post',
            data
        })
    },
    
    updateCar: (data) => {
        return http({
            url: 'api/car',
            method: 'put',
            data
        })
    },
    
    deleteCar: (id) => {
        return http({
            url: `api/car/${id}`,
            method: 'delete'
        })
    },
    
    getCarPage: (pageNum, pageSize, data) => {
        return http({
            url: 'api/car/page',
            method: 'post',
            params: {
                pageNum: pageNum,
                pageSize: pageSize
            },
            data
        })
    }
}
